/*************************************************************************
 * gOkey - A tile based game for Gnome.                                  *
 * Copyright (C) 2008  Onur Aslan  <onuraslan@gmail.com>                 *
 *                                                                       *
 * This program is free software: you can redistribute it and/or modify  *
 * it under the terms of the GNU General Public License as published by  *
 * the Free Software Foundation, either version 3 of the License, or     *
 * (at your option) any later version.                                   *
 *                                                                       *
 * This program is distributed in the hope that it will be useful,       *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 * GNU General Public License for more details.                          *
 *                                                                       *
 * You should have received a copy of the GNU General Public License     *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 *************************************************************************/

#include <gtk/gtk.h>
#include "gokey.h"

/* default gui variables */
#define WIDTH               700
#define HEIGHT              500
#define BOARDWIDTH          320
#define BOARDHEIGHT         200

#define RACKWIDTH           500
#define RACKHEIGHT          148
#define BOARDMARGIN         5
#define RACKFLINEXMARGIN    8
#define RACKFLINEYMARGIN    9
#define RACKSLINEXMARGIN    8
#define RACKSLINEYMARGIN    79
#define TILEWIDTH           43
#define TILEHEIGHT          60
#define TILEPADDING         3

typedef struct Position_ {
  int x, y, width, height;
} Position;

typedef struct Rack_ {
  Position rack;
  Position first_line;
  Position second_line;
} Rack;

GtkWidget *window;
GtkWidget *board;
GtkWidget *statusBar;

GdkPixbuf *rackPixbuf;
GdkPixbuf **tilesPixbuf;

void configure_pixbufs (void);
GdkPixbuf *get_tile_pixbuf (Tile tile);

GtkWidget *create_board (void);
void draw_tiles_new_game (void);
void draw_tiles (void);
void draw_rack (void);
void draw_everything (void);
void clear_screen (void);
